package com.zj;

import com.zj.config.SpringConfig;
import com.zj.dao.StudentDao;
import com.zj.dao.UserDao;
import com.zj.pojo.User;
import com.zj.service.StudentService;
import com.zj.service.UserService;
import com.zj.service.impl.UserServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = ctx.getBean(UserService.class);
        UserDao userDao = ctx.getBean(UserDao.class);
        User outUser = userDao.selectByDId(8);
        User inUser = userDao.selectByDId(9);
        System.out.println(inUser);
        System.out.println(outUser);
        System.out.println(userService.transfer(outUser,inUser,100));



    }
}